const state={
    total:0,
    page:1,
    limit:10,
    news:[],
    nodeSelected:{}
}

const getters={
    getTotal(){
        return state.total
    },
    getPage(){
        return state.page
    },
    getLimit(){
        return state.limit
    },
    getNews(){
        return state.news
    },
    getNodeSelected(){
        return state.nodeSelected
    }
}


const mutations={
    changePage:(state,payload)=>{
        state.page=payload
    },
    changeLimit:(state,payload)=>{
        state.limit=payload
    },
    changeTotal:(state,payload)=>{
        state.total=payload
    },
    changeNews:(state,payload)=>{
        state.news=payload
    },
    changeNodeSelected:(state,payload)=>{
        state.nodeSelected=payload
    }
}

const actions={
    changePage:({ commit },payload)=>{
        commit('changePage',payload)
    },
    changeLimit:({ commit },payload)=>{
        commit('changeLimit',payload)
    },
    changeTotal:({ commit },payload)=>{
        commit('changeTotal',payload)
    },
    changeNews:({ commit },payload)=>{
        commit('changeNews',payload)
    },
    changeNodeSelected:({ commit },payload)=>{
        commit('changeNodeSelected',payload)
    }
}
export default {
	state,
	getters,
	mutations,
	actions
}